package com.how2java.tmall.service;

import org.springframework.stereotype.Service;

/**
 * @Author: Andy
 * @Date: 2021年12月05日
 * @Description:
 */
@Service
public class OrderService {
//    public static final String waitPay = "waitPay";
//    public static final String waitDelivery = "waitDelivery";
//    public static final String waitConfirm = "waitConfirm";
//    public static final String waitReview = "waitReview";
//    public static final String finish = "finish";
//    public static final String delete = "delete";
//
//    @Autowired
//    OrderDAO orderDAO;
//
//    public Page4Navigator<Order> list(int start, int size, int navigatePages) {
//        Sort sort = new Sort(Sort.Direction.DESC, "id");
//        Pageable pageable = new PageRequest(start, size,sort);
//        Page pageFromJPA =orderDAO.findAll(pageable);
//        return new Page4Navigator<>(pageFromJPA,navigatePages);
//    }
//
//    public void removeOrderFromOrderItem(List<Order> orders) {
//        for (Order order : orders) {
//            removeOrderFromOrderItem(order);
//        }
//    }
//
//    private void removeOrderFromOrderItem(Order order) {
//        List<OrderItem> orderItems= order.getOrderItems();
//        for (OrderItem orderItem : orderItems) {
//            orderItem.setOrder(null);
//        }
//    }
//
//    public Order get(int oid) {
//        return orderDAO.findOne(oid);
//    }
//
//    public void update(Order bean) {
//        orderDAO.save(bean);
//    }
}
